package comm;

import java.io.Serializable;

//Mensagens enviadas dos clientes para os servidor. 

//classe implementa também a interface serializable que permite que seja enviada através do socket .

public class ServerMessage implements ServerSideMessage , Serializable{
	/**
	 * 
	 */
	private static final long serialVersionUID = 5561581704889017675L;
	private Type message_type;
	private String message_payload;
	private String message_sender;
	
	public ServerMessage(String m_sender , String m_payload , Type m_type){
		this.message_sender = m_sender;
		this.message_payload = m_payload;
		this.message_type = m_type;
	}
	@Override
	public Type getType() {
		// TODO Auto-generated method stub
		return this.message_type;
	}

	@Override
	public String getPayload() {
		// TODO Auto-generated method stub
		return this.message_payload;
	}

	@Override
	public String getClientNickname() {
		// TODO Auto-generated method stub
		return this.message_sender;
	}

}
